package com.xingkeduo.service;

import com.github.pagehelper.PageInfo;
import com.xingkeduo.model.param.AttendancePageParam;
import com.xingkeduo.model.param.AttendanceParam;
import com.xingkeduo.model.po.TStaffAttendance;
import com.xingkeduo.model.vo.*;
import com.xingkeduo.util.tool.ResponseMessage;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 考勤服务接口
 *
 * @Author: 中文输入法发挥不稳定的刘川
 * @Date: 19-3-15 下午7:05
 */
public interface StaffAttendanceService {

    int batchInsertForInit(List<TStaffAttendance> attendanceList);

    int initAttendanceForOneStaff(Long staffId, String staffName, Long storeId, String storeName, Long managerId, Date mondayDate);

    List<TStaffAttendance> initOneAttendance(Long staffId, String staffName, Long storeId, String storeName, Long managerId, Date mondayDate);

    ResponseMessage updateStaffWorkTime(List<TStaffAttendance> attendanceList);

    ResponseMessage getImpactOrderByScheduling(TStaffAttendance staffAttendance);

    Map<Long, StaffAttendanceSummaryVo> getStaffAttendance(String selectedDate, Long storeId, Long staffId);

    List<StaffAttendanceVo> getStaffAttendanceByStaffId(Long staffId, String date);

    StoreAttendanceVo getStaffAttendanceByStoreId(Long storeId);

    List<StaffAttendanceVo> getAttendanceOfPersonal(AttendanceParam param);

    List<StaffSchedulingVo> getStaffSchedulingByStoreId(Long storeId);

    List<StoreSchedulingVo> getStoreSchedulingByStaffId(Long staffId,String storeName);

    /**
     * @param storeId
     * @param staffId
     * @param weekDay
     * @return com.xingkeduo.util.tool.ResponseMessage
     * @description 取消员工排班，同时取消员工库存
     * @author 中文输入法发挥不稳定的刘川
     * @date 19-4-24 下午6:14
     */
    ResponseMessage unableStaffAttendanceByStoreIdAndStaffIdAndWeek(Long storeId, Long staffId, Date weekDay);

    void makeRestStatusBySystem(Long storeId, Date attendanceDate, Integer intervalTime, Integer alreadyStaffNumInStore, Integer seatNum);

    int updateResetAttendanceTypeByAfterDateAndShopId(@Param("dateOfMonday") Date dateOfMonday, @Param("shopId") Long shopId, @Param("modifier") Long modifier);

    int updateEmptyAttendanceTimeByAfterDateAndShopId(@Param("nowDate") Date nowDate, @Param("shopId") Long shopId, @Param("modifier") Long modifier);

    /** 查出历史打卡店铺 by staffId **/
    List<StoreInfoVo> getAttendanceStoresByStaffId(Long staffId);
    /** 查询发型师排班总量 **/
    int countAttendanceByStaffIdAndStoreId (Long storeId, Long staffId, Date selectDate);

    List<String> getAttendanceByStaffIdAndStoreId(Long storeId, Long staffId, String selectDate);
    /** 根据店铺Id 重置当前周及以后排班状态为临时 **/
    int updateAttendanceTypeByStoreId(Long storeId, String selectDate);

    int staffStoreMaxNumberOfDays(Long storeId,Long staffId);

    /** 根据上下班状态 时间 获取排班Id集合 **/
    List<TStaffAttendance> getAttendanceIdByStatusAndDate(int status, String selectDate);

    int batchUpdateStatusById(List<Integer> ids);


    /**
     * 测试一下分页
     * @return
     */
    PageInfo<CmsStaffAttendancePageVo> getAttendanceList(AttendancePageParam attendancePageParam);
    /**根据考勤ID查询库存信息**/
    CmsStaffAttendanceVo getAttendanceInfo(Integer attendanceId);

}
